#include <iostream>
#include <cstdio>

int const maxn = 1002;
int da[maxn];
int n, m;

int main()
{
	int T;
	std::cin >> T;
	for (int ti = 1; ti <= T; ti++) {
		std::cout << "Case #" << ti << ":\n";
		std::cin >> m >> n;
		int sum = 0;
		for (int i = 0; i < n; i++) {
			std::cin >> da[i];
			sum += da[i];
		}
		for (int i = 0; i < n; i++)
			std::printf("%.6f\n", m*double(da[i])/double(sum));
	}
}

